import React from 'react'
import { Link, Control } from 'react-keeper'
import 'weui';
import fangzi from './../../assets/icon/房子.png';
import { ButtonArea,Panel,PanelHeader,PanelBody,Page,
  Button,
  CellsTitle,
  CellsTips,
  Cell,
  CellHeader,
  CellBody,
  CellFooter,
  Form,
  FormCell,
  Icon,
  Input,
  Label,
  TextArea,
  Switch,
  Radio,
  Checkbox,
  Select,
  VCode,Flex,
  FlexItem,
  MediaBox,
  MediaBoxHeader,
  MediaBoxBody,
  MediaBoxTitle,
  MediaBoxDescription,
  MediaBoxInfo,
  MediaBoxInfoMeta,
  Agreement,
  Toptips
} from  'react-weui/build/packages';
const appMsgIcon = <img
  src=""/>



export default class EngItem extends React.Component {

  constructor(props) {
    super(props);
    this.state = {
    }
    this.mypreview = this.mypreview.bind(this);
  }

  mypreview() {
    Control.go('/myinfo/engview',this.props.eng);
  }

  shouldComponentUpdate(nextProps = {}, nextState = {}) {
    const thisProps = this.props || {},
      thisState = this.state || {};

    if (Object.keys(thisProps).length !== Object.keys(nextProps).length ||
      Object.keys(thisState).length !== Object.keys(nextState).length) {
      return true;
    }

    for (const key in nextProps) {
      if (thisProps[key] !== nextProps[key] || !is(thisProps[key], nextProps[key])) {
        console.log(thisProps[key], nextProps[key]);
        return true;
      }
    }

    for (const key in nextState) {
      if (thisState[key] !== nextState[key] || !is(thisState[key], nextState[key])) {
        return true;
      }
    }

    return false;
  }

  render() {
    return (

      <Cell >
        <CellHeader  access link onClick={this.mypreview} style={{position: 'relative', marginRight: '10px'}}>
          <img src={fangzi} alt="" o style={{display: `block`, width: `20px`, marginRight: `5px`}}/>
        </CellHeader>
        <CellBody>
          <p>{this.props.eng.engName}  </p>

          <p style={{fontSize: '13px', color: '#888888'}}>  { this.props.eng.engJsdw }</p>
          <p style={{fontSize: '13px', color: '#888888'}}>{ this.props.eng.engAddress}</p>
        </CellBody>
      </Cell>

    )
  }
}

EngItem.propTypes = {
  eng: React.PropTypes.object.isRequired,
  imgls: React.PropTypes.object.isRequired
}




